home *** CD-ROM | disk | FTP | other *** search
/ Practical Internet 2002 November / Practical Internet November 2002.iso / pc / Software / Workshops / gg_setup.exe / #setuppath# / ggcss.exe / linktop.asp < prev    next >
Encoding:
Text File  |  2002-05-01  |  5.7 KB  |  181 lines

  1. <%@LANGUAGE="VBSCRIPT"%>
  2. <!-- #include file="connex.asp" -->
  3. <%
  4. d1 = Request.Form("d1")
  5. If d1 = "" Then
  6. d1 = "L1_color.asp"
  7. End If
  8. d2=Left(d1, 2)
  9. d3=Right(d2, 1)
  10. D1_ID=d3+4
  11. set rsCss = Server.CreateObject("ADODB.Recordset")
  12. rsCss.ActiveConnection = connex
  13. rsCss.Open = "SELECT * FROM CSS WHERE ID = "&D1_ID&""
  14. %>
  15. <HTML>
  16. <HEAD>
  17. <TITLE>Text Control</TITLE>
  18. <base target="output">
  19. </HEAD>
  20. <BODY BGCOLOR=#D4D0C8 topmargin="0" leftmargin="0"> 
  21. <!-- #include file="colorpalette.asp" -->
  22. <form method="POST" action="process_<%=(Left(d1,2))%>.asp" NAME=do_text target="output">
  23.   <p align="center">
  24.   <b><font face="Times New Roman">Font</font></b>
  25.   <font color="#C0C0C0">
  26. <%
  27. set rsConfig = Server.CreateObject("ADODB.Recordset")
  28. rsConfig.ActiveConnection = connex
  29. rsConfig.Source = "SELECT SYS_FONTS FROM CONFIG"
  30. rsConfig.CursorType = 0
  31. rsConfig.CursorLocation = 2
  32. rsConfig.LockType = 3
  33. rsConfig.Open()
  34. rsConfig_numRows = 0
  35. SYS_FONTS=rsConfig.Fields.Item("SYS_FONTS").Value
  36. If SYS_FONTS="True" Then
  37. const HKEY_LOCAL_MACHINE    = &H80000002
  38. set obj = CreateObject( "a1asp.reg" )
  39. Set FontFso = CreateObject("Scripting.FileSystemObject")
  40. Set WindPath = FontFso.GetSpecialFolder(0)
  41. WinLen=Len(WindPath)
  42. WindPath=Right(WindPath, (WinLen-3))
  43. WindPath=Lcase(WindPath)
  44. If WindPath = "winnt" Then
  45. obj.RootKey = HKEY_LOCAL_MACHINE
  46. obj.OpenKey "\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts", false
  47. Else
  48. obj.RootKey = HKEY_LOCAL_MACHINE
  49. obj.OpenKey "\SOFTWARE\Microsoft\Windows\CurrentVersion\Fonts", false
  50. End If
  51. %>
  52. <select name="fonts" onchange=do_text.submit()>
  53. <option selected><%=rsCss("FONT")%></option>
  54. <%
  55. x = obj.GetValueNames
  56. if( x>0 ) then
  57. for z=0 to x-1
  58. ok = obj.GetValueName( z )
  59. ok=LCase(ok)
  60. Set LetrChk = NEW RegExp
  61. LetrChk.Pattern = "\("
  62. LetrChk.Global = True
  63. ch1 = LetrChk.Replace(ok, "")
  64. SET LetrChk=Nothing
  65. Set LetrChk = NEW RegExp
  66. LetrChk.Pattern = "\)"
  67. LetrChk.Global = True
  68. ch2 = LetrChk.Replace(ch1, "")
  69. SET LetrChk=Nothing
  70. Set LetrChk = NEW RegExp
  71. LetrChk.Pattern = "truetype"
  72. LetrChk.Global = True
  73. ch3 = LetrChk.Replace(ch2, "")
  74. SET LetrChk=Nothing
  75. Set LetrChk = NEW RegExp
  76. LetrChk.Pattern = "all res"
  77. LetrChk.Global = True
  78. ch4 = LetrChk.Replace(ch3, "")
  79. SET LetrChk=Nothing
  80. Set LetrChk = NEW RegExp
  81. LetrChk.Pattern = "res"
  82. LetrChk.Global = True
  83. ch5 = LetrChk.Replace(ch4, "")
  84. SET LetrChk=Nothing
  85. Set LetrChk = NEW RegExp
  86. LetrChk.Pattern = "vga"
  87. LetrChk.Global = True
  88. ch6 = LetrChk.Replace(ch5, "")
  89. SET LetrChk=Nothing
  90. Set LetrChk = NEW RegExp
  91. LetrChk.Pattern = "plotter"
  92. LetrChk.Global = True
  93. ch7 = LetrChk.Replace(ch6, "")
  94. SET LetrChk=Nothing
  95. Set LetrChk = NEW RegExp
  96. LetrChk.Pattern = "[^abcdefghijklmnopqrstuvwxyz ]"
  97. LetrChk.Global = True
  98. ch8 = LetrChk.Replace(ch7, "")
  99. SET LetrChk=Nothing
  100. Set LetrChk = NEW RegExp
  101. LetrChk.Pattern = "\(Windows"
  102. LetrChk.Global = True
  103. ch9 = LetrChk.Replace(ch8, "")
  104. SET LetrChk=Nothing
  105. ch=ch9
  106. If InStr(ch, "bold") or InStr(ch, "italic") or InStr(ch, "normal") or InStr(ch, "oblique") or InStr(ch, "extra bold") or InStr(ch, "bold italic") or InStr(ch, "regular") Then
  107. else
  108. Lench=Len(ch)
  109. FirstCap=Ucase(Left(ch, 1))
  110. FirstRest=Right(ch, (Lench-1))
  111. FirstWord=FirstCap&FirstRest
  112. Response.Write "<option value='"&FirstWord&"'>"&FirstWord&"</option>"
  113. end if
  114. next
  115. Response.Write "</select>"
  116. end if
  117. obj.CloseKey
  118. set obj = Nothing
  119. Else
  120. rsConfig.Close()
  121. set rsFonts = Server.CreateObject("ADODB.Recordset")
  122. rsFonts.ActiveConnection = connex
  123. rsFonts.Source = "SELECT * FROM FONTS ORDER BY FONT_NAME ASC"
  124. rsFonts.CursorType = 2
  125. rsFonts.CursorLocation = 2
  126. rsFonts.LockType = 3
  127. rsFonts.Open()
  128. rsFonts_numRows = 0
  129. Response.Write "<select name='fonts' onchange=do_text.submit()>"
  130. If rsFonts.EOF Then
  131. Response.Write "<option value=''>No Fonts Found</option>"
  132. Else
  133. Response.Write "<option selected>"&rsCss("FONT")&"</option>"
  134. While (NOT rsFonts.EOF)
  135. Response.Write "<option value='"&rsFonts.Fields.Item("FONT_NAME").Value&"'>"&rsFonts.Fields.Item("FONT_NAME").Value&"</option>"
  136. rsFonts.MoveNext()
  137. Wend
  138. If (rsFonts.CursorType > 0) Then
  139. rsFonts.MoveFirst
  140. Else
  141. rsFonts.Requery
  142. End If
  143. Response.Write "</select>"
  144. End If
  145. rsFonts.Close()
  146. End If
  147. %>
  148.   </font>
  149.   <p align="center">
  150.   <b><font face="Times New Roman">Size</font></b><font color="#C0C0C0"><select size="1" name="txt_size" onchange=do_text.submit()>
  151.   <option selected><%=rsCss("SIZE")%></option>
  152.   <option value="8pt">8pt</option>
  153.   <option value="9pt">9pt</option>
  154.   <option value="10pt">10pt</option>
  155.   <option value="11pt">11pt</option>
  156.   <option value="12pt">12pt</option>
  157.   <option value="13pt">13pt</option>
  158.   <option value="14pt">14pt</option>
  159.   <option value="15pt">15pt</option>
  160.   <option value="16pt">16pt</option>
  161.   <option value="17pt">17pt</option>
  162.   <option value="18pt">18pt</option>
  163.   <option value="20pt">20pt</option>
  164.   <option value="22pt">22pt</option>
  165.   <option value="24pt">24pt</option>
  166.   <option value="26pt">26pt</option>
  167.   <option value="28pt">28pt</option>
  168.   <option value="30pt">30pt</option>
  169.   <option value="32pt">32pt</option>
  170.   <option value="34pt">34pt</option>
  171.   <option value="36pt">36pt</option>
  172.   </select></font>
  173.   <p align="center">
  174.   <b>| B<font color="#C0C0C0"><input type="checkbox" onclick=do_text.submit() name="BOLD" <%If (rsCss("BOLD")) = "True" then response.write " checked"%> value="ON"></font> | <i>I</i><font color="#C0C0C0"><input type="checkbox" onclick=do_text.submit() name="ITALIC" <%If (rsCss("ITALIC")) = "True" then response.write " checked"%> value="ON"></font> 
  175.   | <u>U</u><font color="#C0C0C0"><input type="checkbox" onclick=do_text.submit() name="UNDERLINE" <%If (rsCss("UNDERLINE")) = "True" then response.write " checked"%> value="ON"></font> | </b> </form>
  176. </BODY>
  177. </HTML>
  178. <%
  179. rsCss.Close
  180. Set rsCss = Nothing
  181. %>